﻿using SqlSugar;

namespace MyCrawlerDemo
{
    [SugarTable("Category")]
    public class JdCategory
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
        [SugarColumn(IsNullable = true)]
        public string? Code { get; set; }
        [SugarColumn(IsNullable = true)]
        public string? ParentCode { get; set; }
        [SugarColumn(IsNullable = true)]
        public string? Name { get; set; }
        [SugarColumn(IsNullable = true)]
        public int Level { get; set; }
        [SugarColumn(IsNullable = true)]
        public string? Url { get; set; }
        [Navigate(NavigateType.OneToMany, nameof(JdCategory.ParentCode), nameof(Code))]
        public List<JdCategory>? Children { get; set; } = null;
    }
}
